package cn.good.yan.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 冻结快照
 *
 * @author shengren.yan
 * @create 2024-02-22
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "s_sto_tbl")
public class StorageTbl {

    @TableField(value = "xid")
    private String xid;

    /**
     * 产品id
     */
    @TableField(value = "product_id")
    private Long productId;

    /**
     * 总库存
     */
    @TableField(value = "freeze_total")
    private Integer freezeTotal;

    /**
     * 事务状态：0：try；1：commit  2 rollback
     */
    @TableField(value = "status")
    private Integer status;

}


//    CREATE TABLE `s_sto_tbl` (
//        `xid` varchar(50) NOT NULL COMMENT '事务id',
//        `product_id` bigint DEFAULT NULL COMMENT '产品id',
//        `freeze_total` decimal(10,0) DEFAULT NULL COMMENT '冻结库存',
//        `status` int DEFAULT NULL COMMENT '事务状态：0：try；1：commit  2 rollback ',
//        PRIMARY KEY (`xid`) using BTREE
//        ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='冻结快照';
